// 引入mongoose第三方模块
const mongoose = require('mongoose');
// 导入config模块
const config = require('config');
console.log(config.get('db.host'))


mongoose.connect(`mongodb://${config.get('db.host')}/${config.get('db.name')}`, { useNewUrlParser: true })
	.then(() => console.log('数据库连接成功'), console.log(`mongodb://${config.get('db.host')}/${config.get('db.name')}`))
	.catch(() => console.log('数据库连接失败'))
